<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/html">
<head>
    <title>佣金规则</title>
    <link rel="stylesheet" type="text/css" href="/static/new_ui/css/upload.css">
    <link rel="stylesheet" href="/static/new_ui/css/house-v1.6.css">

    <link rel="stylesheet" type="text/css" href="/static/new_ui/new_css/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="/static/new_ui/new_css/base_v3.0.css">
    <script type="text/javascript" src="/static/new_ui/new_js/jquery.js"></script>
    <script type="text/javascript" src="/static/new_ui/new_js/base_v3.0.js"></script>
    <script type="text/javascript" src="/static/new_ui/new_js/bootstrap.min.js"></script>
    <script type="text/javascript" src="/static/new_ui/new_js/build.js"></script>
    <script type="text/javascript" src="/static/new_ui/js/jquery.Jcrop.js"></script>
    <script type="text/javascript" src="/static/new_ui/js/naryouuploadx.js"></script>
    <script type="text/javascript" src="/static/new_ui/new_js/colpick.js"></script>

    <style type="text/css">
        .font-color_ {color:red}
    </style>
</head>
<body class="white-bg">

<div class="container-fluid warp tops">
    <h1 class="page-headers no-icon" style="padding-left:0">注册与邀请好友</h1>
    <form id="formId">
        <input type="hidden" name="linkType" value="ZBRW"/>
        <input type="hidden" name="enable" value="1"/>
        <input type="hidden" name="taskIds" value="1241"/>
        <input type="hidden" name="taskIds" value="1242"/>
        <input type="hidden" name="taskIds" value="1237"/>
      <div id="myCustom" class="tab-content yykf clearFix " style="padding-bottom:60px">
        <p class="brokerage_set">新客户注册后，可获得购房币数量&nbsp;: &nbsp;<input type="text" maxlength="7" id="zhuRewardQty" name="zhuRewardQty" value="200" class="w140"/><span id="msg_zhuRewardQty" class="font-color_"></span></p>
        <p class="brokerage_set1">新客户绑定个人微信号，可获得购房币数量&nbsp;: &nbsp;<input type="text" maxlength="7" id="bingRewardQty" name="bingRewardQty" value="200" class="w140"/><span id="msg_bingRewardQty" class="font-color_"></span></p>
        <p class="brokerage_set1">老客户邀请新客户注册,可获得购房币</p>
        <div class="reg_invite clearFix">
            <p>1、每直接带来1个新客户注册</p>
            <p class="p3 p2">老客户可获得购房币数量 : <input type="text" id="inviteMoney" maxlength="7" name="inviteMoney" value="100" class="w140"/><span id="msg_inviteMoney" class="font-color_"></span></p>
            <p class="p3 p2">新客户可获得购房币数量 : <input type="text" id="invitedMoney" maxlength="7" name="invitedMoney" value="500" class="w140"/><span id="msg_invitedMoney" class="font-color_"></span></p>
            <p class="p1">2、每间接带来1个新客户注册</p>
            <p class="p3 p2 left">支持间接影响层级 :</p>
            <div class="dropdown-list">
                <div class="drop-list drop-list-min">
                    <input type="hidden" name="influenceLevel" class="hidValue" id="influenceLevel" value="3"/>
                    <div class="checked drop"><a href="javascript:void(0);">3</a><span></span></div>
                    <span id="msg_influenceLevel" class="font-color_"></span>
                </div>
                <ul class="select select-min none drop_ul" style="left: 215px;margin-top: 4px;">
                    <li><a href="javascript:void(0);" data="0">0</a></li>
                    <li><a href="javascript:void(0);" data="1">1</a></li>
                    <li><a href="javascript:void(0);" data="2">2</a></li>
                    <li><a href="javascript:void(0);" data="3">3</a></li>
                    <li><a href="javascript:void(0);" data="4">4</a></li>
                    <li><a href="javascript:void(0);" data="5">5</a></li>
                </ul>
            </div>
            <p class="p3 p2">老客户可获得购房币数量 :&nbsp;<input type="text" maxlength="7" id="influenceMoney" name="influenceMoney" value="10" class="w140"/><span id="msg_influenceMoney" class="font-color_"></span></p>
            <p class="p1">3、防刷币</p>
            <p class="p3 p2">每日每人允许"直接"带来新客户注册数量的上限 :&nbsp;<input name="registTimes" id="registTimes" maxlength="4"   maxlength="4" type="text" value="10" class="w140"/><span id="msg_registTimes" class="font-color_"></span></p>
            <p class="p3 p2">每日每人允许"间接"带来新客户注册的获得购房币次数的上限 :&nbsp;<input  type="text" id="limitTimes" name="limitTimes" maxlength="4" value="10" class="w140"/><span id="msg_limitTimes" class="font-color_"></span></p>
            <div class="info-model p1">
                <span class="head long-head" style="color:#333333;font-weight:normal">4、邀请好友注册时，分享出去的展示内容</span>
                    <span class="show-ico">
                        <span class="show-info" style="top:-150px;height:380px">
                            <i></i>
                            <img src="/static/new_ui/images/show-info-img02.jpg" width="100%" height="100%" alt=""/>
                        </span>
                    </span>
                <div class="contents">
                    <div class="share-con" style="margin-top:0px;background-color:white">
                       <i class="upload-pic-btn naryou-upload imgLoad" style="margin-top: 8px;border-style:none;width:82px; height:82px" canDelete="deleteValue" required = "true" data-options="{uploadUrl:'/upload/INVITETASK/img/', canCrop: true, cropWidth: 200, cropHeight: 200}">
                        <img  src="http://img.fcstatic.naryou.cn/img/INVITETASK/20141129/1417226528669.jpg">
                        <input  type="hidden" name="sharePic" id="sharePic" class="path" value="/img/INVITETASK/20141129/1417226528669.jpg"/>
                       </i>
                        <textarea  class="rule_set-textarea"  style="height:82px;margin-top: 9px;margin-left:14px;resize:none "id="title" type="text" name="title" maxlength="26" value="越分享，越富有！" onkeyup="validateInput(this,'txt-num1_id',26)" cols="45" rows="3" style="resize: none;" > 越分享，越富有！</textarea><span class="txt-num1"><i  id="txt-num1_id">8</i>/<i>26</i></span>
                        <span id="msg_title" class="font-color_"></span>
                        <span id="msg_sharePic" class="font-color_"></span>
                    </div>
            </div>

        </div>
        <div class="add-item clearFix">
            <a class="button btn-success btn-w100" id="btn-success_id" data-toggle="modal">保存</a>
            <a class="button btn-gray btn-w100" href="#" data-toggle="modal">取消</a>
        </div>
    </div>
    </div>
    </form>
</div>
</div>
</body>

<script type="text/javascript">

    function validateInput(obj,id,maxlen) {
        obj = $(obj);
        var len = obj.val().length;
        $('#' + id ).html(len);
    }
     $(function(){
         $("#btn-success_id").bind('click',function(){
             var reg = /^\d{0,7}$/;
             var reg1 = /^\d{0,1}$/;
             //新客户可获得购房币数量
             var invitedMoney = $("#invitedMoney").val();
             //老客户可获得购房币数量
             var inviteMoney = $("#inviteMoney").val();
             //新客户注册后
             var zhuRewardQty = $("#zhuRewardQty").val();
             //新客户绑定个人微信号
             var bingRewardQty = $("#bingRewardQty").val();
             //支持间接影响层级
             var influenceLevel = $("#influenceLevel").val();
             //老客户可获得购房币数量
             var influenceMoney = $("#influenceMoney").val();
             //每日每人允许"直接"带来新客户注册数量的上限
             var limitTimes = $("#limitTimes").val();
             //每日每人允许"间接"带来新客户注册的获得购房币次数的上限
             var registTimes = $("#registTimes").val();
             var sharePic = $("#sharePic").val();
             var title = $("#title").val();
             if(zhuRewardQty.length>0){
                 if(!reg.test(zhuRewardQty)){
                     $("#msg_zhuRewardQty").html("必须输入合法的1~7位的正整数");
                     return;
                 }else{
                     $("#msg_zhuRewardQty").empty();
                 }
             }else{
                 $("#msg_zhuRewardQty").html("不能为空!");
                 return;
             }
             if(bingRewardQty.length>0){
                 if(!reg.test(bingRewardQty)){
                     $("#msg_bingRewardQty").html("必须输入合法的1~7位的正整数");
                     return;
                 }else{
                     $("#msg_bingRewardQty").empty();
                 }
             }else{
                 $("#msg_bingRewardQty").html("不能为空!");
                 return;
             }

             if(inviteMoney.length>0){
                 if(!reg.test(inviteMoney)){
                     $("#msg_inviteMoney").html("必须输入合法的1~7位的正整数");
                     return;
                 }else{
                     $("#msg_inviteMoney").empty();
                 }
             }else{
                 $("#msg_inviteMoney").html("不能为空!");
                 return;
             }

             if(invitedMoney.length>0){
                 if(!reg.test(invitedMoney)){
                     $("#msg_invitedMoney").html("必须输入合法的1~7位的正整数");
                     return;
                 }else{
                     $("#msg_invitedMoney").empty();
                 }
             }else{
                 $("#msg_invitedMoney").html("不能为空!");
                 return;
             }
             if(influenceLevel.length>0){
                 if(!reg1.test(influenceLevel)){
                     $("#msg_influenceLevel").html("请输入合法的数字!");
                     return;
                 }else if(influenceLevel>5){
                     $("#msg_influenceLevel").html("层级只支持1-5级!");
                     return;
                 }else{
                     $("#msg_influenceLevel").empty();
                 }
             }else{
                 $("#msg_influenceLevel").html("不能为空!");
                 return;
             }
             if(influenceMoney.length>0){
                 if(!reg.test(influenceMoney)){
                     $("#msg_influenceMoney").html("必须输入合法的1~7位的正整数");
                     return;
                 }else{
                     $("#msg_influenceMoney").empty();
                 }
             }else{
                 $("#msg_influenceMoney").html("不能为空!");
                 return;
             }
             if(limitTimes.length>0){
                 if(!reg.test(limitTimes)){
                     $("#msg_limitTimes").html("必须输入合法的1~7位的正整数");
                     return;
                 }else{
                     $("#msg_limitTimes").empty();
                 }
             }else{
                 $("#msg_limitTimes").html("不能为空!");
                 return;
             } if(registTimes.length>0){
                 if(!reg.test(registTimes)){
                     $("#msg_registTimes").html("必须输入合法的1~7位的正整数");
                     return;
                 }else{
                     $("#msg_registTimes").empty();
                 }
             }else{
                 $("#msg_registTimes").html("不能为空!");
                 return;
             }
             if(sharePic.length==0){
                 $("#msg_sharePic").html("请上传图片!");
                 return;
             }else{
                 $("#msg_sharePic").empty();
             }
             if(title.length==0) {
                 $("#msg_title").html("请输入标题!");
                 return;
             }else{
                 $("#msg_title").empty();
             }
             $.ajax({
                 url:"/merse/estate/regular_task/modifyRegularTask",
                 type:"post",
                 data: $("#formId").serialize(),
                 success: function(data){
                     if (data.success) {
                         saveResult(1,data.msg);
                     } else {
                         saveResult(0,data.msg);
                     }
                 },error : function(data) {
                     saveResult(0,data.msg);
                 }
             })
         })



     })
    $(function() {
        var options = {
            uploadUrl : "/upload/INVITETASK/img/",  //统一配置上传图片的路径
            uploadInputName : 'filedata' //后台接收文件的名称
        };
        uploadDialogTools.initUploadOptions(options);  //初始化上传参数
        uploadDialogTools.init(); //初始化上传图片按钮
        uploadDialogTools.bindOnBeforeShowDialog(beforeSelected); //绑定显示上传弹出层之前的回调事件（可选）
        uploadDialogTools.bindOnSelected(selected); //绑定上传对话框点确认按钮之后的回调事件（可选）
    });

     /**
      *   确认上传成功之后设置图片描述信息的值
      *   uploadArea为点击的上传的Dom元素（jQuery对象）
      */
     function selected(uploadArea){
         var img = $(uploadArea).find("img");
         img.siblings("i").remove();
         img.after('<i class="delete_img_btn"></i>');

         //获取上传图片的全路径
         var url = $(uploadArea).find("img").attr("src");
         if(url){
             //移除默认图片样式，将src设置为上传图片的路径
             $("#wapVal_zst").attr("src",url);
         }
     }
     /**
      *   在显示上传对话框之前初始化图片描述信息
      *   uploadArea为点击的上传的Dom元素（jQuery对象）
      */
     function beforeSelected(uploadArea){
         $("#txtImageContent").val(uploadArea.find(".content").val());
     }

    $(function(){
        $(".drop-list").each(function(i){
            var $select = $(this).parent().find(".select");
            var $checked = $(this).find(".checked");
            var $hidValue = $(this).find(".hidValue")
            $select.find('li').each(function(e){
                $(this).on('click',function(){
                    var txt = $(this).find('a').text();
                    $hidValue.val($(this).find('a').attr("data"));
                    $checked.find('a').text(txt);
                    $(this).parent().addClass('none');
                    $checked.removeClass('current');
                    return false;
                })
            });

        });
    });

</script>

</html>








